<template>

   <!-- 设置语言为中文 -->
   <el-config-provider :locale="locale">
      <router-view></router-view>
   </el-config-provider>
</template>

<script setup>
 import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
 const locale = zhCn
</script>

<style>
/* 确保 ElMessageBox 居中显示并优化样式 */
.el-message-box__wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.el-message-box {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 0 !important;
  min-width: 300px !important;
  max-width: 90% !important;
  background-color: #fff !important;
  overflow: hidden !important;
}

.el-message-box__header {
  padding: 20px 20px 0 !important;
  margin: 0 !important;
}

.el-message-box__title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #303133 !important;
  line-height: 1.4 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.el-message-box__headerbtn {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: pointer !important;
  font-size: 16px !important;
  color: #909399 !important;
}

.el-message-box__headerbtn:hover {
  color: #409eff !important;
}

.el-message-box__headerbtn .el-message-box__close {
  font-size: 16px !important;
}

.el-message-box__status {
  position: relative !important;
  top: 0 !important;
  transform: none !important;
  font-size: 20px !important;
  margin-right: 12px !important;
  vertical-align: middle !important;
  display: inline-flex !important;
  align-items: center !important;
}

.el-message-box__message {
  padding-left: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.el-message-box__content {
  padding: 20px !important;
  margin: 0 !important;
  font-size: 14px !important;
  color: #606266 !important;
  line-height: 1.5 !important;
  word-break: break-all !important;
  display: flex !important;
  align-items: center !important;
}

.el-message-box__input {
  padding: 0 20px !important;
  margin: 0 !important;
}

.el-message-box__btns {
  padding: 10px 20px 20px !important;
  margin: 0 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  border-top: 1px solid #f0f0f0 !important;
}

.el-message-box__btns button {
  padding: 8px 20px !important;
  font-size: 14px !important;
  border-radius: 4px !important;
  min-width: 80px !important;
}

.el-message-box__btns .el-button--default {
  border-color: #dcdfe6 !important;
  color: #606266 !important;
}

.el-message-box__btns .el-button--primary {
  background-color: #409eff !important;
  border-color: #409eff !important;
}

.el-message-box__btns .el-button--danger {
  background-color: #f56c6c !important;
  border-color: #f56c6c !important;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .el-message-box {
    width: 85% !important;
    margin: 0 auto !important;
  }

  .el-message-box__header {
    padding: 15px 15px 0 !important;
  }

  .el-message-box__content {
    padding: 15px !important;
  }

  .el-message-box__btns {
    padding: 10px 15px 15px !important;
    flex-direction: column-reverse !important;
  }

  .el-message-box__btns button {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
  }

  .el-message-box__btns button:first-child {
    margin-top: 0 !important;
  }

  .el-message-box__headerbtn {
    top: 15px !important;
    right: 15px !important;
  }
}
</style>
